
#include "MSE_ANONYMITY.h"

union ANONYMITY_UNION_Typdef MSE_V_ANONYMITY_UNION ={ 0 };

void MSE_F_ANONYMITY_TX(int16_t NUM1 , int16_t NUM2 , int16_t NUM3 , int16_t NUM4 , int16_t NUM5 , int16_t NUM6 , int16_t NUM7 , int16_t NUM8 , int16_t NUM9)
{
    MSE_V_ANONYMITY_UNION.TX.HEAD   = 0xAA;
    MSE_V_ANONYMITY_UNION.TX.D_ADDR = 0xFF;
    MSE_V_ANONYMITY_UNION.TX.ID     = 0xF1;
    MSE_V_ANONYMITY_UNION.TX.LEN    = 18;

    MSE_V_ANONYMITY_UNION.TX.NUM1 = NUM1;
    MSE_V_ANONYMITY_UNION.TX.NUM2 = NUM2;
    MSE_V_ANONYMITY_UNION.TX.NUM3 = NUM3;
    MSE_V_ANONYMITY_UNION.TX.NUM4 = NUM4;
    MSE_V_ANONYMITY_UNION.TX.NUM5 = NUM5;
    MSE_V_ANONYMITY_UNION.TX.NUM6 = NUM6;
    MSE_V_ANONYMITY_UNION.TX.NUM7 = NUM7;
    MSE_V_ANONYMITY_UNION.TX.NUM8 = NUM8;
    MSE_V_ANONYMITY_UNION.TX.NUM9 = NUM9;

    uint8_t sumcheck = 0;
    uint8_t addcheck = 0;

    for (uint8_t i = 0; i < (MSE_V_ANONYMITY_UNION.DATA[3]+4); i++)
    {
        sumcheck += MSE_V_ANONYMITY_UNION.DATA[i];
        addcheck += sumcheck;
    }

    MSE_V_ANONYMITY_UNION.TX.SUMCHECK = sumcheck;
    MSE_V_ANONYMITY_UNION.TX.ADDCHECK = addcheck;

    HAL_UART_Transmit_IT(&huart6 , MSE_V_ANONYMITY_UNION.DATA , 24);

}

void MSE_F_AN_REVOLVE(void)
{
    MSE_F_ANONYMITY_TX((int16_t) 0 ,
                       (int16_t) 0 ,
                       (int16_t) 0 ,
					   (int16_t) 0 ,
                       (int16_t) 0 ,
                       (int16_t) 0 ,
                       (int16_t) 0 ,
                       (int16_t) 0 ,
                       (int16_t) 0
    );

}
